create  table jms_dm.dm_service_site_out_brand_cooperate_company_agg_dt
(
`agency_code`  varchar(100) COMMENT '代理区code',
servicesitecode  varchar(100) comment '服务点code' ,
cooperate_company  varchar(100) comment '合作公司',
 `province`  varchar(100) COMMENT '省份',
 `city`  varchar(100) COMMENT '城市',
 `area`  varchar(100) COMMENT '区',
 `expresscompanycode`  varchar(100) COMMENT '快递公司编码',
 `site_in_cnt` int(12) COMMENT '入库量',
 `site_out_cnt` int(12) COMMENT '出库量',
 `site_abnormal_out_cnt` int(12) COMMENT '异常出库量',
 `site_current_out_cnt` int(12) COMMENT '当日出库量',
 `site_current_end_cnt` int(12) COMMENT '当日完结量',
 `site_t1_out_cnt` int(12) COMMENT 'T+1日出库量',
 `site_t1_end_cnt` int(12) COMMENT 'T+1日完结量',
 `site_t3_out_cnt` int(12) COMMENT 'T+3日出库量',
 `site_t3_end_cnt` int(12) COMMENT 'T+3日完结量',
 `site_t6_out_cnt` int(12) COMMENT 'T+6日出库量',
 `site_t6_end_cnt` int(12) COMMENT 'T+6日完结量',
 `agency_name`  varchar(100) COMMENT '代理区名字',
`province_code`  varchar(100) COMMENT '省code',
`city_code`  varchar(100) COMMENT '城市code',
`area_code`  varchar(100) COMMENT '区code',
servicesitename  varchar(100) comment '服务点' ,
`site_in_date` date COMMENT '入库日期'
)
ENGINE=OLAP
DUPLICATE KEY(agency_code,servicesitecode,cooperate_company)
comment '百世出入库统计网点品牌合作公司汇总报表'
PARTITION BY RANGE (site_in_date) (
   START ("2023-03-12") END ("2023-05-11") EVERY (INTERVAL 1 day))DISTRIBUTED BY HASH(servicesitecode) BUCKETS 4
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-185",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "4",
"in_memory" = "false",
"storage_format" = "V2"
);